package admincow.servlet.raza;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import admincow.dao.RazaDAO;
import admincow.vo.RazaVO;

 public class RazaActualizarServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
   static final long serialVersionUID = 1L;
   

	public RazaActualizarServlet() {
		super();
	}   	
		
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}  	

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		int id = Integer.parseInt(request.getParameter("idRaza"));
		RazaVO vo = new RazaVO();
		vo.setIdraza(id);
		vo.setNombre(request.getParameter("nombre"));
		vo.setDescripcion(request.getParameter("descripcion"));

		RazaDAO dao = new RazaDAO();
		dao.actualizar(vo);
		request.getRequestDispatcher("razaBuscar.jsp").forward(request,
				response);
	}
	   	  	    
}